<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='https://unpkg.com/@antv/l7'></script>
    <script src="https://lib.baomitu.com/jquery/2.2.4/jquery.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0
        }

        #map {
            width: 100vw;
            height: 100vh;
        }

        html,
        body {
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div id="map">

    </div>
    <script>
        var { Scene, GaodeMap } = L7;
        const scene = new Scene({
            id: 'map',
            map: new GaodeMap({
                /* dark|light|normal */
                style: 'normal', // 样式URL
                center: [114.30, 30.50],
                pitch: 30,
                zoom: 12,
                // token: '3851594382e218c49865a4d6a5170b52',
            }),
            logoVisible: false
        });
        scene.on("loaded", () => {
            $.ajax({
                url: "/data/Wuhan_roads.json"
            }).then(data => {
                console.log(data)
                const layer = new L7.LineLayer({
                })
                    .source(data)
                    .size(1)
                    .shape('line')
                    .color('#1990FF')
                    .animate({
                        interval: 1, // 间隔
                        duration: 2, // 持续时间，延时
                        trailLength: 2 // 流线长度
                    });

                scene.addLayer(layer)
            })
        })
    </script>
</body>

</html>